#include <iostream>
#include <CommandLineArguments.hxx>
#include <Encoding.hxx>
int cmdUnknownArgument(const char *args, void *) {
std::cout << "cmd Unknown Options " << args
              << std::endl;
  return 1;
}


int main(int argc,char **argv)
{
    bool help=false;
    std::string driverModel;
    std::string profile;
    int port;
    cmsys::Encoding::CommandLineArguments encoding_cmd=cmsys::Encoding::CommandLineArguments::Main(argc,argv);
    int Argc=encoding_cmd.argc();
    char const *const* Argv=encoding_cmd.argv();
    typedef cmsys::CommandLineArguments argT;
    cmsys::CommandLineArguments Args;
    Args.Initialize(Argc,Argv);
    Args.AddArgument("--help", argT::NO_ARGUMENT, &help,
                     "Cmd Print Help");
    Args.AddArgument("-D", argT::SPACE_ARGUMENT, &driverModel, "Driver Model");
    Args.AddArgument("-P", argT::SPACE_ARGUMENT, &port, "Server Lister Ports");
    Args.AddArgument("-C", argT::SPACE_ARGUMENT, &profile, "Set Profile");
    Args.SetUnknownArgumentCallback(cmdUnknownArgument);
    int parsed=Args.Parse();
    if(help)
    {
      std::cout<<"Print Usage:"<<std::endl;
      std::cout << Args.GetHelp() << std::endl;
      return 0;
    }
    if(parsed)
    {
      std::cout << "Parser:" << parsed << std::endl;
      std::cout<<"Profile: "<<profile<<"\nDriver Model:"<<driverModel<<"\nPorts:"<<port<<std::endl;
    }
    return 0;
}

